package com.itqf.service.impl;

import com.itqf.entity.Product;
import com.itqf.mapper.ProductDao;
import com.itqf.service.ProductService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/9/30
 * @Time: 上午11:11
 */
//@Component   通用
//@Service(value="productServiceImpl")  //<bean id="productDaoImpl" class="xxx.ProductServiceImpl">
@Component
//@Scope("singleton")
public class ProductServiceImpl2 implements ProductService {
    //依赖dao(mapper)
    @Resource //按照名字注入
    private ProductDao productDao;

    public ProductDao getProductDao() {
        return productDao;
    }

    public void setProductDao(ProductDao productDao) {
        this.productDao = productDao;
    }

    @Override
    public List<Product> findAll() {
        return productDao.findAll();
    }

    @Override
    public int update(Product product) {
        return productDao.update(product);
    }
}
